s=6
sum=0

num=int(input())

for i in range(0,num):
    sum+=s
    s=s*10+6

print(sum)